<template>
  <main-container :navList="navList" :options="options" :isShowIframeHeader="false" :is-tab="false" />
</template>

<script>
  import MainContainer from '@/common/components/mainContainerMenu';
  import Api from '../../api/incomeAndExpenditurePlan';

  export default {
    name: 'InformMain',

    components: {
      MainContainer,
    },

    data() {
      return {
        options: [],
        navList: [],
      };
    },
    created() {
      //年度计划审批
      if (this.$route.query.planType == 'year') {
        this.navList = [
          {
            name: '编制总结',
            menuUrl: '/businessPlan/planApprove/planSummarize',
          },
          {
            name: '经营性收入',
            menuUrl: '/businessPlan/planApprove/planRevenue',
          },
          {
            name: '经营性支出',
            menuUrl: '/businessPlan/planApprove/planExpenditure',
          },
          {
            name: '非经营性收入',
            menuUrl: '/businessPlan/planApprove/nonOperatingIncome',
          },
          {
            name: '非经营性支出',
            menuUrl: '/businessPlan/planApprove/nonOperatingExpenses',
          },
          {
            name: '重点关注',
            menuUrl: '/businessPlan/planApprove/planFocus',
          },
          {
            name: '审批信息',
            menuUrl: '/businessPlan/planApprove/approveInfo',
          },
        ];
      }
      // 执行计划审批
      else {
        this.navList = [
          {
            name: '计划总览',
            menuUrl: '/businessPlan/planApprove/planSummarize',
          },
          {
            name: '收入调整事项',
            menuUrl: '/businessPlan/planApprove/planRevenueChange',
          },
          {
            name: '支出调整事项',
            menuUrl: '/businessPlan/planApprove/planExpenditureChange',
          },
          {
            name: '经营性收入',
            menuUrl: '/businessPlan/planApprove/planRevenue',
          },
          {
            name: '经营性支出',
            menuUrl: '/businessPlan/planApprove/planExpenditure',
          },
          {
            name: '非经营性收入',
            menuUrl: '/businessPlan/planApprove/nonOperatingIncome',
          },
          {
            name: '非经营性支出',
            menuUrl: '/businessPlan/planApprove/nonOperatingExpenses',
          },
          {
            name: '审批信息',
            menuUrl: '/businessPlan/planApprove/approveInfo',
          },
        ];
      }
    },
    mounted () {
      Api.constant({}).then(res => {
      this.$store.state.planconstantMap = res;
    });
    this.plandetail();
    },
    methods: {
      plandetail() {
      // if (this.$route.query.processWorkId) {
      //   Api.planInfoDetail({ primaryKey: this.$route.query.processWorkId }).then(res => {
      //     this.$store.state.planDetail = res;
      //     this.isShowSubmit = false;
      //   });
      // } else

      if (this.$route.query.planKey) {
        Api.plandetail({ primaryKey: this.$route.query.planKey }).then(res => {
          this.$store.state.planDetail = res;
        });
      }
    },
    },
  };
</script>
